package na.learn.java.adt.stack;

import java.util.LinkedList;

public class SimpleStack implements Stack {

	private static final int maxSize = 100;

	private int currentPos;

	Object[] internalStack;

	public SimpleStack() {
		internalStack = new Object[100];
	}

	public boolean push(Object obj) {
		if (currentPos <= maxSize)
			return false;
		else
			internalStack[currentPos++] = obj;
		return true;

	}

	public Object pop() {
		if (currentPos == 0)
			return null;
		else
			return internalStack[currentPos--];

	}

	public boolean isEmpty() {
		return (currentPos == 0);

	}

}
